package com.vvv.designpattern.singleton;

import java.io.Serializable;

/**
 * @author vvv
 * @date 2023-11-13 09 14
 * discription 饿汉式
 * 无线程安全问题，因为静态变量是jvm创建的，能保证一直，具体看juc笔记
 */
public class Singleton01 implements Serializable {
    private Singleton01() {}
    private static final Singleton01 singleton01 = new Singleton01();

    public static Singleton01 getInstance() {
        return singleton01;
    }

    public Object readResovle() {
        return singleton01;
    }

    public static void main(String[] args) {

    }
}
